def say_hi(name):
    print(f"hi {name}")


# say_hi("里斯")

# 定义一个函数来实现两数相加
def add(a, b):
    """

    :param a:
    :param b:
    :return:
    """
    print(a + b)


# add(1,2)
# add(b=1,a=2)


# 自制一个计算器实现加减乘除
def caculator(a, b, operate):
    # if operate == '+':
    #     print(a+b)
    # if operate == '-':
    #     print(a-b)
    # if operate == '*':
    #     print(a*b)
    # if operate == "/":
    #     print(a/b)

    # eval可以动态的执行字符串形式的代码
    print(eval(f"{a}{operate}{b}"))


caculator(1, 2, "-")
